﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.Oxilly.Qasparov.QsbClient.QsbCommandService;
using System.Runtime.Serialization;

namespace Com.Oxilly.Qasparov.TwitterExtensionConfigurator
{
    //TODO: This class should be part of the twitterExtension Itself... but see remarks below

    public class TwitterExtensionConfigurationMessage : QsbMessage
    {
        //TODO: Refrence to Com.Oxilly.Qasparov.Twitter.TwitterExtension
        //Those constants should be referenced from Com.Oxilly.Qasparov.Twitter.TwitterExtension
        //But before that, the DefaultExtension project should be dived into a Client Library and QsbCode,
        //So a client app (like this) should not reference the entire Qsb Project (like QsbCore)
        private static String OAUTH_CONFIGURATE = "com.oxilly.qasparov.twitter.oath_config";
        private static String OAUTH_CONSUMER_KEY = "ConsumerKey";
        private static String OAUTH_CONSUMER_SECRET = "ConsumerSecret";
        private static String OAUTH_OATH_TOKEN = "OAuthToken";
        private static String OAUTH_ACCESS_TOKEN = "AccessToken";

        public TwitterExtensionConfigurationMessage()
        {
            this.MessageType = OAUTH_CONFIGURATE;
        }

        public String ConsumerKey
        {
            get { return this.MessageAttributes[OAUTH_CONSUMER_KEY]; }
            set { this.MessageAttributes[OAUTH_CONSUMER_KEY] = value; }
        }

        public String  ConsumerSecret
        {
            get { return this.MessageAttributes[OAUTH_CONSUMER_SECRET]; }
            set { this.MessageAttributes[OAUTH_CONSUMER_SECRET] = value; }
        }

        public String OAuthToken
        {
            get { return this.MessageAttributes[OAUTH_OATH_TOKEN]; }
            set { this.MessageAttributes[OAUTH_OATH_TOKEN] = value; }
        }

        public String AccessToken
        {
            get { return this.MessageAttributes[OAUTH_ACCESS_TOKEN]; }
            set { this.MessageAttributes[OAUTH_ACCESS_TOKEN] = value; }
        }
    }
}
